<template>
  <div class="home-block-wrap">
    <div class="home-block-title">
      <img v-if="titleIcon" src="titleIcon"/>
      <span>{{title}}</span>
    </div>
    <div class="home-block-content">
      <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: 'HomeBlock',
  props: {
    // 标题的icon
    titleIcon: {
      type: String,
      default: ''
    },
    // 标题
    title: {
      type: String,
      default: ''
    }
  }
};
</script>

<style lang="less" scoped>
  .home-block-wrap {
    margin-top: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: #fff;
    .home-block-title {
      height: 3rem;
      line-height: 3rem;
      padding: 0 1rem;
      font-size: 1.6rem;
      border-bottom: 1px solid #ddd;
      color: #333;
    }
    .home-block-content {
      padding: 1rem;
    }
  }
</style>
